﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using Cinchoo.Core.IO;
using Cinchoo.Core.Collections;
using System.IO;
using System.Collections;
using System.Data.SqlClient;
using System.Threading;
using System.Data;
using System.Text.RegularExpressions;
using System.Data.SQLite;

namespace Cinchoo.Core.ETL
{
    public class ChoETLSQLiteCommandTask : ChoETLBaseDbCommandTask
    {
        #region Constructors

        public ChoETLSQLiteCommandTask(string connectionString, string sql) : base(connectionString, sql)
        {
        }

        public ChoETLSQLiteCommandTask(IDbConnection connection, string sql, IDbTransaction trans = null)
            : base(connection, sql, trans)
        {
        }

        #endregion Constructors

        #region Overrides

        protected override IDbCommand CreateCommand(string sql, IDbConnection conn)
        {
            return new SQLiteCommand(sql, conn as SQLiteConnection);
        }

        protected override IDbConnection CreateConnection(string connectionString)
        {
            return new SQLiteConnection(connectionString);
        }

        protected override IDbDataParameter CreateDataParameter(string paramName)
        {
            return new SQLiteParameter(paramName, DbType.Object);
        }

        #endregion Overrides
    }
}
